/**
 * api地址追加前缀
 * @param { Object } obj 需要追加的 api 对象
 * @param { String } prefix 前缀
 */
export const apiAppendPrefix = (obj: AnyObject, prefix: string) => {
  Object.keys(obj).forEach(k => {
    let path = obj[k] || ''
    if (typeof path === 'object' && Object.prototype.toString.call(path) === '[object Object]') {
      apiAppendPrefix(path, prefix)
    } else {
      obj[k] = prefix + path
    }
  })
}
